package driver;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.GenericOptionsParser;

/**
 * Regression Driver
 * 
 * @author tigerzhong
 * 
 */
public class RegressionDriver {

    /**
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
	String[] otherArgs = new GenericOptionsParser(new Configuration(), args)
		.getRemainingArgs();
	if (otherArgs.length != 3) {
	    System.exit(3);
	}
	String type = otherArgs[0]; // train or test
	String confPath = otherArgs[1]; // Configuration file
	String runnerName = otherArgs[2]; // Runner name
	RegressionRunner runner = (RegressionRunner) Class.forName(runnerName)
		.newInstance(); // Reflection
	RegressionRunner.run(runner, confPath, type);
    }

}
